﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class OrderDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(Session[EClass.ESession.IdUser.ToString()] == null)
            Response.Redirect("Login.aspx?ReturnURL=OrderDetail.aspx");
    }
    protected void ASPxGridLookup1_ValueChanged(object sender, EventArgs e)
    {
        return;
        string sql = String.Format(
            @"  SELECT ProductName, Thumbnail, UnitPrice, o.Amount
                FROM Products p INNER JOIN OrdersDetail o ON p.ProductID = o.ProductID
                WHERE OrderID = '{0}'", ASPxGridLookup1.Value);
        DataTable dt = DataAccess.ExecuteQuery(sql);
        GridView1.DataSource = dt;
        GridView1.DataBind();
        if(dt.Rows.Count <= 0)
        {
            _lblMessage.Text = "Bạn chưa từng đặt hàng, nhấn vào <a href=\"Default.aspx \">đây</a> để mua hàng ";
        }
        else
        {
            _lblMessage.Text = "";
        }
        Title = Session["iduser"].ToString();
//        UpdatePanel1.Update();
    }
}
